package com.virtualCat.util;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.GetMethod;
import org.slf4j.LoggerFactory;

public class Tools {
    private static org.slf4j.Logger log = LoggerFactory.getLogger(Tools.class);
	private static HttpClient client;
    private static GetMethod getMethod;
    static {
        client = new HttpClient();
    }
    public static String getStaticString(String URL){
    	 getMethod = new GetMethod(URL);
    	 String jsonText="";
    	 try {

             int status = client.executeMethod(getMethod);
             if (status == HttpStatus.SC_OK) {// HTTP 200 OK
                 log.info("授权状态200");
                 jsonText = getMethod.getResponseBodyAsString();
             }
         } catch (Exception e) {
             e.printStackTrace();
         }
    	 return jsonText;
    }
}
